#define _CRT_SECURE_NO_WARNINGS 1

#include"test.h"

int main()
{
	struct ListNode* n1 = (struct ListNode*)malloc(sizeof(struct ListNode));
	if (n1 == NULL)
	{
		perror("malloc fail");
		return;
	}
	struct ListNode* n2 = (struct ListNode*)malloc(sizeof(struct ListNode));
	if (n2 == NULL)
	{
		perror("malloc fail");
		return;
	}
	struct ListNode* n3 = (struct ListNode*)malloc(sizeof(struct ListNode));
	if (n3 == NULL)
	{
		perror("malloc fail");
		return;
	}
	struct ListNode* n4 = (struct ListNode*)malloc(sizeof(struct ListNode));
	if (n4 == NULL)
	{
		perror("malloc fail");
		return;
	}


	n1->val = 3;
	n2->val = 2;
	n3->val = 0;
	n4->val = -4;

	n1->next = n2;
	n2->next = n3;
	n3->next = n4;
	n4->next = n2;

	struct ListNode* ret=detectCycle(n1);
	printf("%p\n", ret);
	
}